package com.itheima.reggie.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.reggie.common.R;
import com.itheima.reggie.entity.Dish;
import com.itheima.reggie.service.DishService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/dish")
public class DishController {
    @Autowired
    private DishService dishService;

    @RequestMapping("/page")
    public R<Page> getPage(Integer page, Integer pageSize){
//        Page<Dish> dishPage = new Page<>(page,pageSize);
//        Page<Dish> page1 = dishService.page(dishPage);
//        return R.success(page1);

        return  dishService.getPage(page,pageSize);
    }
}
